export default {
  state: {
    selectedTab: 'main',
    hidden: false,
    fullScreen: false
  },
  subscriptions: {
    setup({ dispatch, history }) {
      return history.listen(({ pathname, query }) => {
        console.log('TCL: setup -> query', query);
        console.log('TCL: setup -> pathname', pathname);
        let selectedTab = query.tabName ? query.tabName : 'main';
        dispatch({ type: 'changeTab', selectedTab });
      });
    }
  },
  reducers: {
    changeTab(state, { selectedTab }) {
      return { ...state, selectedTab };
    }
  },
  effects: {
    *fetch({ type, payload }, { put, call, select }) {}
  }
};
